# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-rx
pkgver=4.0.4
pkgrel=5
pkgdesc="Reactive Extensions (Rx) for Python"
url="https://reactivex.io/"
arch="noarch"
license="MIT"
depends="
	python3
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="glib-dev gtk+3.0-dev py3-gobject3 py3-pytest py3-coverage py3-pytest-asyncio"
subpackages="$pkgname-pyc"
source="https://github.com/ReactiveX/RxPY/archive/v$pkgver/py3-rx-$pkgver.tar.gz
	typing-ext.patch
	"
builddir="$srcdir/RxPY-$pkgver"

prepare() {
	default_prepare

	# relied on by publish script
	sed -i "s|\"0.0.0\"|\"$pkgver\"|" pyproject.toml
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5b9f0bf225630d59a899ba5adc89433399e1507e59afa4a0a85423b720b904087f7d578b5b660a43caa09de5ea321faf0f522b7733b1406f9a4354a873672ab0  py3-rx-4.0.4.tar.gz
b960c2f52477c56ef6641df27b833b0d2d4d095b2ce7ff59c8bd06c3df29097b1dee7b79f3ff568b9d320495634ce937ca85b064c3f7fb553c48dc7bbbb77d21  typing-ext.patch
"
